{"ast":null,"code":"import * as React from 'react';\nimport { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\n\n/**\n * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.\n */\n\nfunction useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const [match, setMatch] = React.useState(() => {\n    if (noSsr && supportMatchMedia) {\n      return matchMedia(query).matches;\n    }\n    if (ssrMatchMedia) {\n      return ssrMatchMedia(query).matches;\n    }\n\n    // Once the component is mounted, we rely on the\n    // event listeners to return the correct matches value.\n    return defaultMatches;\n  });\n  useEnhancedEffect(() => {\n    let active = true;\n    if (!supportMatchMedia) {\n      return undefined;\n    }\n    const queryList = matchMedia(query);\n    const updateMatch = () => {\n      // Workaround Safari wrong implementation of matchMedia\n      // TODO can we remove it?\n      // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677\n      if (active) {\n        setMatch(queryList.matches);\n      }\n    };\n    updateMatch();\n    // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n    queryList.addListener(updateMatch);\n    return () => {\n      active = false;\n      queryList.removeListener(updateMatch);\n    };\n  }, [query, matchMedia, supportMatchMedia]);\n  return match;\n}\n\n// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];\nfunction useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {\n  const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);\n  const getServerSnapshot = React.useMemo(() => {\n    if (ssrMatchMedia !== null) {\n      const {\n        matches\n      } = ssrMatchMedia(query);\n      return () => matches;\n    }\n    return getDefaultSnapshot;\n  }, [getDefaultSnapshot, query, ssrMatchMedia]);\n  const [getSnapshot, subscribe] = React.useMemo(() => {\n    if (matchMedia === null) {\n      return [getDefaultSnapshot, () => () => {}];\n    }\n    const mediaQueryList = matchMedia(query);\n    return [() => mediaQueryList.matches, notify => {\n      // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n      mediaQueryList.addListener(notify);\n      return () => {\n        mediaQueryList.removeListener(notify);\n      };\n    }];\n  }, [getDefaultSnapshot, matchMedia, query]);\n  const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n  return match;\n}\nexport default function useMediaQuery(queryInput) {\n  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  const theme = useTheme();\n  // Wait for jsdom to support the match media feature.\n  // All the browsers MUI support have this built-in.\n  // This defensive check is here for simplicity.\n  // Most of the time, the match media logic isn't central to people tests.\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const {\n    defaultMatches = false,\n    matchMedia = supportMatchMedia ? window.matchMedia : null,\n    ssrMatchMedia = null,\n    noSsr\n  } = getThemeProps({\n    name: 'MuiUseMediaQuery',\n    props: options,\n    theme\n  });\n  if (process.env.NODE_ENV !== 'production') {\n    if (typeof queryInput === 'function' && theme === null) {\n      console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n    }\n  }\n  let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;\n  query = query.replace(/^@media( ?)/m, '');\n\n  // TODO: Drop `useMediaQueryOld` and use  `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable\n  const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;\n  const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);\n  if (process.env.NODE_ENV !== 'production') {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useDebugValue({\n      query,\n      match\n    });\n  }\n  return match;\n}","map":{"version":3,"names":["React","getThemeProps","useThemeWithoutDefault","useTheme","useEnhancedEffect","useMediaQueryOld","query","defaultMatches","matchMedia","ssrMatchMedia","noSsr","supportMatchMedia","window","match","setMatch","useState","matches","active","undefined","queryList","updateMatch","addListener","removeListener","maybeReactUseSyncExternalStore","useMediaQueryNew","getDefaultSnapshot","useCallback","getServerSnapshot","useMemo","getSnapshot","subscribe","mediaQueryList","notify","useMediaQuery","queryInput","options","theme","name","props","process","env","NODE_ENV","console","error","join","replace","useMediaQueryImplementation","useDebugValue"],"sources":["/data/messenger.client/node_modules/@mui/material/esm/useMediaQuery/useMediaQuery.js"],"sourcesContent":["import * as React from 'react';\nimport { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\n\n/**\n * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.\n */\n\nfunction useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const [match, setMatch] = React.useState(() => {\n    if (noSsr && supportMatchMedia) {\n      return matchMedia(query).matches;\n    }\n    if (ssrMatchMedia) {\n      return ssrMatchMedia(query).matches;\n    }\n\n    // Once the component is mounted, we rely on the\n    // event listeners to return the correct matches value.\n    return defaultMatches;\n  });\n  useEnhancedEffect(() => {\n    let active = true;\n    if (!supportMatchMedia) {\n      return undefined;\n    }\n    const queryList = matchMedia(query);\n    const updateMatch = () => {\n      // Workaround Safari wrong implementation of matchMedia\n      // TODO can we remove it?\n      // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677\n      if (active) {\n        setMatch(queryList.matches);\n      }\n    };\n    updateMatch();\n    // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n    queryList.addListener(updateMatch);\n    return () => {\n      active = false;\n      queryList.removeListener(updateMatch);\n    };\n  }, [query, matchMedia, supportMatchMedia]);\n  return match;\n}\n\n// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];\nfunction useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {\n  const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);\n  const getServerSnapshot = React.useMemo(() => {\n    if (ssrMatchMedia !== null) {\n      const {\n        matches\n      } = ssrMatchMedia(query);\n      return () => matches;\n    }\n    return getDefaultSnapshot;\n  }, [getDefaultSnapshot, query, ssrMatchMedia]);\n  const [getSnapshot, subscribe] = React.useMemo(() => {\n    if (matchMedia === null) {\n      return [getDefaultSnapshot, () => () => {}];\n    }\n    const mediaQueryList = matchMedia(query);\n    return [() => mediaQueryList.matches, notify => {\n      // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n      mediaQueryList.addListener(notify);\n      return () => {\n        mediaQueryList.removeListener(notify);\n      };\n    }];\n  }, [getDefaultSnapshot, matchMedia, query]);\n  const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n  return match;\n}\nexport default function useMediaQuery(queryInput, options = {}) {\n  const theme = useTheme();\n  // Wait for jsdom to support the match media feature.\n  // All the browsers MUI support have this built-in.\n  // This defensive check is here for simplicity.\n  // Most of the time, the match media logic isn't central to people tests.\n  const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n  const {\n    defaultMatches = false,\n    matchMedia = supportMatchMedia ? window.matchMedia : null,\n    ssrMatchMedia = null,\n    noSsr\n  } = getThemeProps({\n    name: 'MuiUseMediaQuery',\n    props: options,\n    theme\n  });\n  if (process.env.NODE_ENV !== 'production') {\n    if (typeof queryInput === 'function' && theme === null) {\n      console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n    }\n  }\n  let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;\n  query = query.replace(/^@media( ?)/m, '');\n\n  // TODO: Drop `useMediaQueryOld` and use  `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable\n  const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;\n  const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);\n  if (process.env.NODE_ENV !== 'production') {\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    React.useDebugValue({\n      query,\n      match\n    });\n  }\n  return match;\n}"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,aAAa,EAAEC,sBAAsB,IAAIC,QAAQ,QAAQ,aAAa;AAC/E,OAAOC,iBAAiB,MAAM,4BAA4B;;AAE1D;AACA;AACA;;AAEA,SAASC,gBAAgB,CAACC,KAAK,EAAEC,cAAc,EAAEC,UAAU,EAAEC,aAAa,EAAEC,KAAK,EAAE;EACjF,MAAMC,iBAAiB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAI,OAAOA,MAAM,CAACJ,UAAU,KAAK,WAAW;EACnG,MAAM,CAACK,KAAK,EAAEC,QAAQ,CAAC,GAAGd,KAAK,CAACe,QAAQ,CAAC,MAAM;IAC7C,IAAIL,KAAK,IAAIC,iBAAiB,EAAE;MAC9B,OAAOH,UAAU,CAACF,KAAK,CAAC,CAACU,OAAO;IAClC;IACA,IAAIP,aAAa,EAAE;MACjB,OAAOA,aAAa,CAACH,KAAK,CAAC,CAACU,OAAO;IACrC;;IAEA;IACA;IACA,OAAOT,cAAc;EACvB,CAAC,CAAC;EACFH,iBAAiB,CAAC,MAAM;IACtB,IAAIa,MAAM,GAAG,IAAI;IACjB,IAAI,CAACN,iBAAiB,EAAE;MACtB,OAAOO,SAAS;IAClB;IACA,MAAMC,SAAS,GAAGX,UAAU,CAACF,KAAK,CAAC;IACnC,MAAMc,WAAW,GAAG,MAAM;MACxB;MACA;MACA;MACA,IAAIH,MAAM,EAAE;QACVH,QAAQ,CAACK,SAAS,CAACH,OAAO,CAAC;MAC7B;IACF,CAAC;IACDI,WAAW,EAAE;IACb;IACAD,SAAS,CA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